﻿using System.Windows;
using System.Windows.Controls;
using Red.Controls.DataDriven;
using Red.Controls.ViewModels;

namespace Red.Controls
{
    /// <summary>
    /// Interaction logic for RedTreeItemView.xaml
    /// </summary
    public partial class RedTreeItemView : UserControl
    {
        public RedTreeItemView()
        {
            InitializeComponent();
            DataContextChanged += OnDataContextChanged;
        }

        private void OnDataContextChanged( object sender, DependencyPropertyChangedEventArgs e )
        {
            InteropTreeItem dataItem = e.NewValue as InteropTreeItem;

            if ( dataItem == null )
                return;

            OnTreeItemAttached( dataItem );
        }

        protected virtual void OnTreeItemAttached( InteropTreeItem treeItem )
        {
        }
    }
}
